Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Runtime.​InteropServices.​Marshalling.​SpanMarshaller<​T, TUnmanagedElement>

Assembly: System.Runtime

Inheritance: object → SpanMarshaller

Supports marshalling a <see cref="T:System.Span`1" /> from managed value to a contiguous native array of the unmanaged values of the elements.

Methods

public static Span<​T>
AllocateContainerForManagedElements​(TUnmanagedElement* unmanaged, int numElements)
public static TUnmanagedElement*
AllocateContainerForUnmanagedElements​(Span<​T> managed, Int32& numElements)
public static void
Free​(TUnmanagedElement* unmanaged)
public static Span<​T>
GetManagedValuesDestination​(Span<​T> managed)
Gets a span of the space where the managed collection elements should be stored.
Returns A span over the managed memory that can contain the specified number of elements.
managed A span over the space to store the managed elements.
public static ReadOnlySpan<​T>
GetManagedValuesSource​(Span<​T> managed)
Gets a span of the managed collection elements.
Returns A span of the managed collection elements.
managed The managed collection.
public static Span<​TUnmanagedElement>
GetUnmanagedValuesDestination​(TUnmanagedElement* unmanaged, int numElements)
public static ReadOnlySpan<​TUnmanagedElement>
GetUnmanagedValuesSource​(TUnmanagedElement* unmanaged, int numElements)
public bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj The object to compare with the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.